import Crypt from "../../../utils/Crypt";
import OrderModel from "../../../models/Order";

const orderModel = new OrderModel()

Page({
  data: {
    express: {}
  },
  onLoad: function (options) {
    // console.log(options.id)
    this.fetchData(options.id)
  },
  fetchData(id) {
    orderModel.viewExpress({
      logistics_id: id
    }).then(response => {
      let { data } = response
      data = Crypt.parse(data)
      console.log(data)
      // console.log(JSON.parse(data.express))
      this.setData({
        express: JSON.parse(data.express)
      })
      // console.log(this.data.express.Traces)
    })
  }
});
